/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hochschild.aplicacion.dao.hibernate;

import java.util.List;

import com.hochschild.aplicacion.domain.DataBaseVersion;
import com.hochschild.aplicacion.dao.DataBaseDao;
import org.hibernate.annotations.NamedNativeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Edson
 */


@Repository
public class HibernateDataBaseDao implements DataBaseDao {
   // @Autowired
    private HibernateTemplate hibernateTemplate;

    public String getDataBaseVersion() {
    	List<DataBaseVersion> versiones= hibernateTemplate.findByNamedQuery("getDataBaseVersion");
        return  versiones.get(0).getVersion();
    }

    public HibernateTemplate getHibernateTemplate() {
        return hibernateTemplate;
    }

    public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
        this.hibernateTemplate = hibernateTemplate;
    }

}
